package cn.com.witsystem.mybatisplus.system.controller;


import cn.com.witsystem.mybatisplus.system.domain.SysUserDO;
import cn.com.witsystem.mybatisplus.system.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author ruyulin
 * @since 2019-09-13
 */
@RestController
@RequestMapping("/system/users")
public class SysUserController {

    @Autowired
    SysUserService userService;

    @GetMapping("/{id}")
    public SysUserDO getUser(@PathVariable("id") int id){
        SysUserDO user = userService.getById(id);
        return user;
    }

    @GetMapping("/mapper")
    public SysUserDO getUser(){
        SysUserDO user = userService.getUser(1);
        return user;
    }
}
